#include<bits/stdc++.h>
using namespace std;
float e;
int n,m,l,v,f;
int x,y=3;
int a[10010],b[10010],c[10010];
int d[10010],g[10010];
int main(){
	freopen("detect.in","r",stdin);
	freopen("detect.out","w",stdout);
	cin >>n>>m>>l>>v;
	for (int i=1;i<=n;i++) cin >>a[i]>>b[i]>>c[i];
	for (int i=1;i<=m;i++){
		cin >>f;
		for (int j=1;j<=m;j++){
			a[j]=l-a[j];
			if (a[j]<f) continue;
			e=1.0*sqrt(pow(b[j],2)+2.0*c[j]*(a[j]-f));
			if (e>v){
				d[j]+=1;
			}
		}
	}
	for (int i=1;i<=n;i++){
		if (d[i]!=0) x+=1;
	}
	cout <<x<<" "<<y;
	return 0;
}
